<?php
$this->Html->addCrumb('Image Gallery');
?>
<h1 class="pageTitle">Image Gallery</h1>
<p>Welcome to our image gallery. We hope you enjoy browsing through the albums. </p>

<p>Select a category from which to view photos.</p>

<?php echo $this->Html->image('dog_gallery2.jpg', array("alt"=>'Image Gallery', "class"=>"right", "title"=>"Image Gallery"))?>

<?php
  if (isset($categories) && !empty($categories)) {
    echo '<ul>';
    foreach ($categories as $category) {
      echo '<li>'.$this->Html->link($category['Category']['name'], array('controller' => 'albums', 'action' => 'index', $category['Category']['id']), array("title"=>"View the albums in this category")).' ('.$category[0]['AlbumCount'].' Albums)</li>' ;
    }
    echo '</ul>';
  } else {
    echo '<p>No albums are currently available.</p>';
  }
?>